AS=/usr/local/mips-cross/bin/mipsel-elf-as
CC=/usr/local/mips-cross/bin/mipsel-elf-gcc
LD=/usr/local/mips-cross/bin/mipsel-elf-ld
OBJCOPY=/usr/local/mips-cross/bin/mipsel-elf-objcopy
OBJDUMP=/usr/local/mips-cross/bin/mipsel-elf-objdump

all:
	$(AS) -mips1 mult.S -o mult.o -EL 
	$(LD) -mips1 -T ../../lib/default.ld mult.o -o mult.elf -EL
	$(OBJCOPY) -j .startup.bootvec -j .startup -O binary mult.elf mult.bin
	hexdump -e "1/4 \"%08x\n\"" mult.bin -v > mult.hex
	cat ../../lib/nops.hex >> mult.hex
	
dump:
	$(OBJDUMP) -j .startup.bootvec -j .startup -D mult.elf

symbols:
	$(OBJDUMP) -t mult.elf

sections:
	$(OBJDUMP) -h mult.elf

clean:
	rm -f mult.bin mult.elf mult.hex mult.o
